package com.kmwiki.Server;
import java.io.IOException;
import javax.servlet.http.*;

import com.kmwiki.Utility.*;
import com.kmwiki.Utility.Net.*;

@SuppressWarnings("serial")
public class Gplus extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		String RedirectUrl = "http://%1$s.tripexplore.net/photo.jsp";
		String servername = PrjInfo.getRandomServerName();
	    RedirectUrl = String.format(RedirectUrl, servername);
    
		String QueryString = req.getQueryString();
		if (QueryString == null) QueryString = "path=posts&id=108979762451884041474&num=8";
		
		myRegular mRegular = new myRegular(QueryString);
		String mPathQueryStr = mRegular.GetTextFirst("path=(.*?)&");
		QueryString = QueryString.replaceAll(mPathQueryStr, "");
		String mPath = myString.CheckNull(req.getParameter("path"),"posts");
			
		String Url = RedirectUrl + "?" + QueryString;
		resp.sendRedirect(Url);

//		String htmlContent = (new myHttp()).getURL(Url, "UTF8");
//		resp.setContentType("text/html; charset=utf-8");		
//		resp.getWriter().print(htmlContent);
		
	}
}
